<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // const arr=[1,2,3,4]
        // const arr1=[...arr] //数组的复制
        // console.log(arr1)
        // const obj={
        //     id:101,
        //     name:"wwp"
        // }

        // const obj1={...obj};
        // console.log(obj1)

        //合并数组和对象
        // const arr1=[1,2,3,4]
        // const arr2=[2,4,6,8]
        // const arr3=[...arr1,...arr2]
        // console.log(arr3)
        // let len=arr3.length
        // console.log(len)

        const obj={
            id:101,
            name:"wwp"
        }
        const obj1={
            id:102,
            name:"wwq"
        }
        const obj2={...obj,...obj1}
        console.log(obj2)       //属性值相同时，后者会覆盖前者的值
    </script>
</body>
</html>